import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
import '@/permission' // permission control

// 注册全局指令
import * as obj from './directives'

// 遍历这个对象,有多少个就注册多少个指令
for (let key in obj) {
  Vue.directive(key, obj[key])
}
// // 获取obj里的所有属性名
// Object.keys(obj)

// 导入所有过滤器里的函数
import * as filters from '@/filters'
for(let key in filters){
  Vue.filter(key,filters[key])
}
// 导入组件
import cmts from './components'
Vue.use(cmts)


// 注册打印
import Print from 'vue-print-nb'
// Global instruction 
Vue.use(Print);

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
